<template>
<view>
	<view class="list" v-for="(item,index) in list" :key="index">
		<view class="money">提现金额:{{item.money}}</view>
		<view class="time">提现时间:{{item.addtime}}</view>
	</view>
</view>
</template>
<script>
import request from '@/util/request.js'
export default {
	data() {
		return{
			list:[],
			page:1,
			pageShow:true
		}
	},
	onLoad:function(){
		uni.showLoading({
		    title: '加载中'  
		});
		this.getlist();
	},
	methods: {
		getlist:function(){
			var that = this;
			var data = {
				uid:uni.getStorageSync('uid'),
				page:this.page
			}
			request({
				url: 'money/take',
				method: 'get',
				data:data,
				success: (res) => {
					uni.hideLoading();
					if(res.data.code == 1){
						if(res.data.data.last_page <= that.page){
							that.pageShow = false
						}
						if(that.page == 1){
							that.list = res.data.data.data
						}else{
							var list = that.list
							that.list = list.concat(res.data.data.data)
						}
					}
				}
			})
		},
		onReachBottom: function(){
			if(this.pageShow){
				 //当前不是最后一页可加载
				 this.page = this.page + 1
				 uni.showLoading()
				 this.getlist();
			}
		}
	}
}
</script>
<style>
.list{
	display: flex;
	flex-direction: column;
	border-bottom: 5rpx solid #CCCCCC;
	padding:15rpx 15rpx 15rpx 15rpx;
}
.money{
    color: #2de09f;
    font-weight: 600;
}
.time{
	font-size:13px;
	margin-top:15rpx;
}
</style>